﻿{template header}
<!--{eval $adlist = $this->fromcache("adlist");}-->
<script type="text/javascript" src="{SITE_URL}js/ueditor/editor_config.js"></script>
<script type="text/javascript" src="{SITE_URL}js/ueditor/editor_all.js"></script>
<script type="text/javascript" src="{SITE_URL}js/ueditor/third-party/SyntaxHighlighter/shCore.js"></script>
<script type="text/javascript" src="{SITE_URL}js/dialog.js"></script>
<link rel="stylesheet" href="{SITE_URL}js/ueditor/themes/default/ueditor.css"/>
<link rel="stylesheet" href="{SITE_URL}js/ueditor/third-party/SyntaxHighlighter/shCoreDefault.css"/>
<div class="content">
    <!--问题分类导航开始-->
    <div class="dh">
        <a href="{SITE_URL}">{$setting['site_name']}</a>
        <!--{loop $navlist $nav}-->
        &gt; <a href="{url category/view/$nav['id']}">{$nav['name']}</a>
        <!--{/loop}-->
    </div>
    <!--问题分类导航结束-->
    <div class="leftbox">
        <!--问题开始-->
        <div class="wenti">
            <div class="wttitle">
                <ul>
                    <li class="wta1"></li>
                    <li class="wta2">
                        <div class="qico" >
                            <div class="iok"></div>
                        </div>
                        已解决
                    </li>
                    <li class="wta3"><a title="您可以在用户中心对所收藏的问题进行浏览" href="{url question/addfavorite/$question['id']/$question['cid']}">收藏该问题</a>&nbsp;&nbsp;<a href="{url question/view/$question['id']/$ordertype}" id="timeorder">{$ordertitle}</a>&nbsp;&nbsp;<a href="{url rss/question/$question['id']}"><img  src="{SITE_URL}css/default/rss.gif"  title="您可以在客户端借助于支持RSS的聚合工具软件，在不打开网站内容页面的情况下阅读网站内容。"/></a><a name="top"></a></li>
                    <li class="wta4"></li>
                </ul>
                <div class="clr"></div> 
            </div>
            <div class="wtallcont">
                <div class="wtleft">
                    <!--{if $question['hidden']}-->
                    <div class="touxiang"><img align="absmiddle" src="{SITE_URL}css/default/avatar.gif" alt="匿名用户" /></div>
                    <div class="hyxinxi">匿名</div>
                    <!--{elseif $question['authorid']==0}-->
                    <div class="touxiang"><img align="absmiddle" src="{SITE_URL}css/default/avatar.gif" alt="匿名用户" /></div>
                    <div class="hyxinxi">{if $question['ip']}{$question['ip']}{else}游客{/if}</div>
                    <!--{else}-->
                    <div class="readFace" id="userinfo-{$question['authorid']}"></div>
                    <div class="touxiang"><a href="{url user/space/$question['authorid']}" target="top"> <img align="absmiddle" src="{$question['author_avartar']}" alt="{$question['author']}" onmouseout="closeuserinfo();" onmouseover="showuserinfo('{$question[authorid]}');" /></a></div>
                    <div class="hyxinxi"><a href="{url user/space/$question['authorid']}" target="top">{$question['author']}</a></div>
                    <!--{/if}-->
                </div>
                <div class="wtright">
                    <div class="wtt">
                        <h1 class="wttit">{$question['title']}</h1>
                        <!--{if !empty($taglist)}-->
                        <div class="wtcont">
                            <!--{loop $taglist $tag}-->
                            <a href="{url question/tag/$tag}" class="qtags">{$tag}</a>
                            <!--{/loop}-->
                        </div>
                        <div class="clr"></div> 
                        <!--{/if}-->
                        <div class="xs">
                            <span class="xsj"><img src="{SITE_URL}css/default/TB2.gif" />悬赏分:{$question['price']}&nbsp; 创建时间：{$asktime}</span> &nbsp;&nbsp;
                            <span class="twsj">
                                <img src="{SITE_URL}css/default/lefttime.gif"> 解决时间：{$bestanswer['adopttime']}&nbsp;&nbsp; 
                                浏览次数:<span id="views">{$question['views']}</span> &nbsp;&nbsp;
                                <a href="javascript:inform('{$question['author']}',1);">举报</a>
                            </span>
                        </div>
                    </div>
                    <div class="qfgx">
                    </div>
                    <div class="wtcont" id="mydescription">
                        {$question['description']}</div>
                    <div class="clr">
                    </div>
                    <!--{if $supplylist}-->
                    <div class="blank10">
                    </div>
                    <div class="wtcont">
                        <!--{loop $supplylist $supply}-->
                        <p class="qs_supply">
                            问题补充:{$supply['format_time']}</p>
                        <div class="qs_supply_cont">
                            {$supply['content']}</div>
                        <!--{/loop}-->
                    </div>
                    <!--{/if}-->
                    <!--{if 1==$user['groupid']}-->
                    <div class="wlhdb">
                        <h1>
                            管理该问题:</h1>
                        <span class="questioncontrol">
                            <input type="button" class="button1" value="编辑问题" onclick="javascript:document.location='{url question/edit/$question['id']}'" /></span>
                        <span class="questioncontrol">
                            <input type="button" class="button1" onclick="managequest(5);return false;" value="修改标签" /></span>
                        <span class="questioncontrol">
                            <input type="button" class="button1" onclick="managequest(3);return false;" value="移动分类"></span>
                        <span class="questioncontrol">
                            <input type="button" class="button1" onclick="managequest(6);return false;" value="删除问题"></span>
                        <div id="edittagdiv" style="display: none;">
                            <!--{eval $tagstr = implode(" ",$taglist);}-->
                            <h5>
                                修改问题标签</h5>
                            <form name="edittagForm" action="{url question/edittag}" method="post">
                            <input type="hidden" value="{$question['id']}" name="qid" />
                            标签以空格隔开<br />
                            <input type="text" name="tag" value="{$tagstr}" class="input2" />
                            <span class="innerrightspan">
                                <input type="submit" class="button4" value="提交" /></span>
                            </form>
                        </div>
                        <div id="editcategorydiv" style="display: none;">
                            <h5>
                                修改问题分类</h5>
                            <form name="editcategoryForm" action="{url question/movecategory}" method="post">
                            <input type="hidden" name="qid" value="{$question['id']}" />
                            移动到：<select name="category" style="width: 240px">{$catetree}</select>
                            <span class="innerrightspan">
                                <input type="submit" class="button4" value="提交" /></span>
                            </form>
                        </div>
                        <div class="clr">
                        </div>
                    </div>
                    <!--{/if}-->
                    <!--{if (isset($adlist['question_view']['inner1']) && trim($adlist['question_view']['inner1']))}-->
                    <div class="wtcont">
                        {$adlist['question_view']['inner1']}</div>
                    <!--{/if}-->
                </div>
                <div class="clr">
                </div>
            </div>
            <div class="wtbuttom">
                <ul>
                    <li class="wtba1"></li>
                    <li class="wtba2"></li>
                    <li class="wtba3"></li>
                    <li class="wtba4"></li>
                </ul>
                <div class="clr">
                </div>
            </div>
        </div>
        <!--问题结束-->
        <!--{if ($setting['question_share'] != "")}-->
        <div class="wtfenxiang">{$setting['question_share']}</div>
        <div class="blank10"></div>
        <!--{/if}-->
        <!--{if (isset($adlist['question_view']['left1']) && trim($adlist['question_view']['left1']))}-->
        <div class="dh">
            {$adlist['question_view']['left1']}</div>
        <!--{/if}-->
        <!--相关已解决-start->
        <div class="wenti">
            <div class="wttitle">
                <ul>
                    <li class="wta1"></li>
                    <li class="wta2">
                        <div class="qico">
                            <div class="irelate">
                            </div>
                        </div>
                        相关已解决 </li>
                    <li class="wta3"></li>
                    <li class="wta4"></li>
                </ul>
                <div class="clr">
                </div>
            </div>
            <div class="clr">
            </div>
            <div class="plc">
                <div class="plclist">
                    <ul>
                        <!--{loop $solvelist $solve}-->
                        <!--{if $question['id'] != $solve['id']}-->
                        <li><a title="{$solve['title']}" href="{url question/view/$solve['id']}" target="_blank">
                            {$solve['title']}</a>&nbsp;<span class="lei">({$solve['answers']}个回答)</span></li>
                        <!--{/if}-->
                        <!--{/loop}-->
                    </ul>
                </div>
            </div>
            <div class="clr">
            </div>
            <div class="qtbuttom">
                <ul>
                    <li class="qtba1"></li>
                    <li class="wtba5"></li>
                    <li class="qtba3"></li>
                    <li class="qtba4"></li>
                </ul>
                <div class="clr">
                </div>
            </div>
        </div>
        <!--相关已解决-end->
        
        <!--自己回答开始-->
        <!--{if ($owneranswerlist) && ($rownum == 1)}-->
        <div id="owner" >
            <div class="qitawenda"><div class="ianswer"></div>自己的回答&nbsp;</div>
        
                        <!--{if $bestanswer}-->
                            <!--最佳答案开始-->
                            <div class="zjda">
                                <div class="zjdatitle">
                                    <ul>
                                        <li class="zja1"></li>
                                        <li class="zja2">
                                            <div class="fimg">
                                                <img width="44px" height="41px" align="absmiddle" src="{SITE_URL}css/default/bestanswer.gif"></div>
                                        </li>
                                        <li class="zja5">最佳答案 </li>
                                        <li class="zja3"></li>
                                        <li class="zja4"></li>
                                    </ul>
                                    <div class="clr">
                                    </div>
                                </div>
                                <div class="zjallcont">
                                    <div class="zjleft">
                                        <div class="readFace" id="Div2">
                                        </div>
                                        <div class="touxiang">
                                            <a target="_blank" href="{url user/space/$bestanswer['authorid']}">
                                                <img align="absmiddle" src="{$bestanswer['author_avartar']}" onmouseout="closeuserinfo();"
                                                    onmouseover="showuserinfo('{$bestanswer[authorid]}');"></a></div>
                                        <div class="hyxinxi">
                                            <span class="name"><a target="_blank" href="/jkzd_showperson.html?id=8702">{$bestanswer['author']}</a></span></div>
                                    </div>
                                    <div class="zjright">
                                        <div class="zjt">
                                            <img align="absmiddle" src="{SITE_URL}css/default/lefttime.gif" />
                                            回答于:{$bestanswer['time']}&nbsp;&nbsp;<a href="javascript:inform('{$bestanswer['author']}',2);">举报</a>
                                        </div>
                                        <div class="qfgx">
                                        </div>
                                        <div class="zjcont">
                                            <div class="wtcont">
                                                {$bestanswer['content']}</div>
                                            <div class="blank10">
                                            </div>
                                            <!--{loop $bestanswer['tags'] $tagindex $tag}-->
                                            <!--{if ($tagindex%2) == 0}-->
                                            <!--{if $tagindex!=0}-->
                                            <div class="ask_gai">
                                            </div>
                                            <!--{/if}-->
                                            <div class="ask_zhuiwen">
                                                <span style="color: #5EBB0B; float: left; margin-right: 5px;">追问:</span>{$tag}
                                            </div>
                                            <!--{else}-->
                                            <div class="ask_gai">
                                            </div>
                                            <div class="ask_zhuiwen">
                                                <span style="color: #999999; float: left; margin-right: 5px;">回答:</span>{$tag}
                                            </div>
                                            <!--{/if}-->
                                            <!--{/loop}-->
                                            <div class="clr">
                                            </div>
                                            <div id="Div3">
                                                <!--{if $bestanswer['comment']}-->
                                                <h4>
                                                    提问者对最佳答案的评价：</h4>
                                                {$bestanswer['comment']}{else}谢谢您的解答！
                                                <!--{/if}-->
                                                <!--{if $bestanswer['commentlist']}-->
                                                <fieldset>
                                                    <legend><a title="查看评分记录" href="{url question/ajaxanswercomment/$bestanswer['id']}">
                                                        该回答评分记录</a></legend>
                                                    <ul>
                                                        <!--{loop $bestanswer['commentlist'] $comment}-->
                                                        <li><em>魅力&nbsp;{if $comment['credit']>0}+$comment['credit']{else}$comment['credit']{/if}</em><em>{echo
                                                            cutstr($comment['content'],40,'');}</em><cite><a target="_blank" href="{url user/space/$comment['authorid']}">{echo
                                                                cutstr($comment['author'],10,'');}</a></cite>{$comment['time']}</li>
                                                        <!--{/loop}-->
                                                    </ul>
                                                </fieldset>
                                                <!--{/if}-->
                                            </div>
                                        </div>
                                        <div class="clr">
                                        </div>
                                        <!--{if 1==$user['groupid']}-->
                                        <div class="wlhdb">
                                            <h1>
                                                管理该回答:</h1>
                                            <span class="questioncontrol">
                                                <input type="button" value="编辑内容" class="button1" onclick="javascript:document.location='{url question/editanswer/$bestanswer['id']}'" /></span>
                                            <div class="clr">
                                            </div>
                                        </div>
                                        <!--{/if}-->
                                        <div class="zjlhdb ">
                                            <p class="zjlhdbimg">
                                                <img width="35px" height="36px" style="cursor: pointer" alt="支持" onclick="add_comment(1,$bestanswer['id'],$bestanswer['authorid']);"
                                                    src="{SITE_URL}css/default/agree.gif">&nbsp;
                                                <img width="35px" height="36px" style="cursor: pointer" alt="反对" onclick="add_comment(0,$bestanswer['id'],$bestanswer['authorid']);"
                                                    src="{SITE_URL}css/default/aganist.gif">&nbsp;
                                            </p>
                                            支持(<span id="Span3" class="zhichi">{$bestanswer['support']}</span>) 反对(<span id="Span4"
                                                class="fandui">{$bestanswer['against']}</span>)
                                        </div>
                                    </div>
                                    <div class="clr">
                                    </div>
                                </div>
                                <div class="zjbuttom">
                                    <ul>
                                        <li class="zjba1"></li>
                                        <li class="zjba2"></li>
                                        <li class="zjba3"></li>
                                        <li class="zjba4"></li>
                                    </ul>
                                </div>
                                <div class="clr">
                                </div>
                            </div>
                            <!--最佳答案结束-->
                        <!--{/if}-->           
            
                        <!--{if !$bestanswer }-->
                            <div class="qita">
            <div class="qitat"></div>            
            <!--{loop $answerlist $index $answer}-->
            <div class="qtallcont">
                <div class="qtleft">
                    <div class="readFace" id="Div4"></div>
                    <div class="touxiang">
                        <a target="_blank" href="{url user/space/$answer['authorid']}"><img align="absmiddle" src="{$answer['author_avartar']}" alt="{$answer['author']}" onmouseout="closeuserinfo();" onmouseover="showuserinfo('{$answer[authorid]}');" /></a>
                    </div>
                    <div class="hyxinxi">
                        <span class="name"><a target="_blank" href="{url user/space/$answer['authorid']}">{$answer['author']}</a></span>
                    </div>
                </div>
                <div class="qtright">
                    <div class="qtt">
                        <div class="louwei"><a href="#top" style="color:#2791FE;">#TOP#</a>&nbsp;&nbsp;{$answer['floor']}楼</div>
                        <img align="absmiddle" src="{SITE_URL}css/default/lefttime.gif" /> 回答于:{$answer['time']}
                        <a href="javascript:inform('{$answer['author']}',2);">举报</a>
                    </div>
                    <div class="clr"></div>
                    <div class="qfgx"></div>
                    <div class="qtcont">
                        <div class="wtcont" id="Div5">{$answer['content']}</div>
                        <div class="blank10"></div>
                        <!--{loop $answer['tags'] $tagindex $tag}-->                        
                        <!--{if ($tagindex%2) == 0}-->
                        <!--{if $tagindex!=0}-->
                        <div class="ask_gai"></div>
                        <!--{/if}-->
                        <div class="ask_zhuiwen">
                            <span style="color:#5EBB0B;float:left;margin-right:5px;">追问:</span>{$tag}
                        </div>                        
                        <!--{else}-->                        
                        <div class="ask_gai"></div>                        
                        <div class="ask_zhuiwen">
                            <span style="color:#999999;float:left;margin-right:5px;">回答:</span>{$tag}
                        </div>

                        <!--{/if}-->
                        <!--{/loop}-->
                        <div class="clr"></div>
                        <!--{if $answer['commentlist']}-->
                        <div id="Div6">
                            <fieldset>
                                <legend><a title="查看回答评分记录" href="{url question/ajaxanswercomment/$answer['id']}" >该回答评分记录</a></legend>
                                <ul>
                                    <!--{loop $answer['commentlist'] $comment}-->
                                    <li><em>魅力&nbsp;{if $comment['credit']>0}+$comment['credit']{else}$comment['credit']{/if}</em><em>{echo cutstr($comment['content'],40,'');}</em><cite><a target="_blank" href="{url user/space/$comment['authorid']}">{echo cutstr($comment['author'],10,'');}</a></cite>{$comment['time']}</li>
                                    <!--{/loop}-->
                                </ul>
                            </fieldset>                            
                        </div>
                        <!--{/if}-->

                        <!--如果是提问者并且不是匿名用户，则显示“采纳为答案”按钮-->
                        <!--{if 0!=$question['authorid'] && ($question['authorid']==$user['uid']) }-->
                        <div class="wtcont">
                            <input type="button"  value="采纳为最佳答案" name="adoptanswer" onclick="adoptanswer({$answer['id']});" class="button2" />&nbsp;
                            <!--{if !$answer['tags'] || (count($answer['tags'])%2) == 0}-->
                            <input type="button"  value="继续追问" name="adoptanswer" onclick="tagquestion({$answer['id']});"  class="button1" />
                            <!--{/if}-->
                        </div>
                        <div class="clr"></div> 
                        <!--{/if}-->

                        <!--如果是回答者自己，则显示“修改答案”按钮-->
                        <!--{if $answer['status'] && ($answer['authorid']==$user['uid']) }-->
                        <input type="button"  value="修改答案" name="button"  class="button1"  onclick="javascript:document.location='{url question/editanswer/$answer['id']}'"/>&nbsp;
                        <!--{if $answer['tags']!='' && (count($answer['tags'])%2) != 0}-->
                        <input type="button"  value="继续回答" name="submit"  onclick="taganswer({$answer['id']});" class="button1"/>
                        <!--{/if}-->
                        <div class="clr"></div> 
                        <!--{/if}-->
                        <div class="clr"></div> 
                        <!--{if 1==$user['groupid']}-->
                        <div  class="wlhdb">
                            <h1>管理该回答:</h1>
                            <input type="button"  value="采纳为最佳答案" name="adoptanswer" onclick="adoptanswer({$answer['id']});" class="button2" />&nbsp;
                            <span class="questioncontrol"><input type="button"  value="编辑内容" class="button1" onclick="javascript:document.location='{url question/editanswer/$answer['id']}'" /></span>
                            <span class="questioncontrol"><input type="button" onclick="delanswer({$answer['id']},{$question['id']});" value="删除回答" class="button1"></span>
                            <div class="clr"></div>
                        </div>
                        <!--{/if}-->
                        <div class="zjlhdb ">
                            <p class="zjlhdbimg">
                                <img width="35px" height="36px"  style="cursor:pointer" alt="支持" onclick="add_comment(1,$answer['id'],$answer['authorid']);" src="{SITE_URL}css/default/agree.gif">&nbsp;
                                <img width="35px" height="36px"  style="cursor:pointer" alt="反对" onclick="add_comment(0,$answer['id'],$answer['authorid']);" src="{SITE_URL}css/default/aganist.gif">&nbsp;
                            </p>
                            支持(<span id="Span5" class="zhichi">{$answer['support']}</span>)
                            反对(<span id="Span6" class="fandui">{$answer['against']}</span>)
                        </div>
                    </div>
                    <!--{if (isset($adlist['question_view']['left3']) && trim($adlist['question_view']['left3']))}-->
                    <div  class="wtcont">{$adlist['question_view']['left3']}</div>
                    <!--{/if}-->
                </div>
                <div class="clr"></div>
            </div>
            <div class="qtbuttom">
                <ul>
                    <li class="qtba1"></li>
                    <li class="qtba2"></li>
                    <li class="qtba3"></li>
                    <li class="qtba4"></li>
                </ul>
                <div class="clr"></div>
            </div>
            <!--{/loop}-->
        </div>
                            <div class="pages">
                                <div class="scott">
                                    {$departstr}</div>
                            </div>
                        <!--{/if}-->
        </div>
        <!--{/if}-->
        <!--自己回答结束-->        
        <!--{if !(($owneranswerlist) && ($rownum == 1)) }-->
        <div class="qitawenda">
            <div class="ianswer"></div>
            网友的回答&nbsp;<span class="qtnum">(共{$rownum}个回答)</span>
            <!--{if $answerlist}-->
                <!--{if ($user['uid'] > 0) && ($neednewbuy) && ($firstbuy == 0)}-->
                    <input type="button" align="right" value="更新购买" id="displayAnswerbutton" onClick="displayAnswer();" />
                <!--{/if}-->            
                <!--{if ($user['uid'] <= 0) || (($firstbuy) && ($neednewbuy == 0))}-->
                    <input type="button" align="right" value="购买" id="displayAnswerbutton" onClick="displayAnswer();" />
                <!--{/if}-->          
            <!--{/if}-->
            <div id="tipsClass">&nbsp;</div>
            <!--{if ($updatecount > 0)}-->
            <span id="updateAnswerNum" class="qtnum">(更新了{$updatecount}个回答)</span>
            <!--{/if}-->
        </div>        
        <!--回答开始-->
        <!--{if $answerlist}-->
            <!--最佳答案开始-->
            <!--{if ($bestanswer) && ((($answer['authorid']!=$user['uid']) && ($user['uid'] > 0) && ($firstbuy == 0) && ($neednewbuy == 0)) || (($bestanswer['authorid']==$user['uid']) && ($user['uid'] > 0))) }-->
                <div class="zjda">
                <div class="zjdatitle">
                    <ul>
                        <li class="zja1"></li>
                        <li class="zja2">
                            <div class="fimg">
                                <img width="44px" height="41px" align="absmiddle" src="{SITE_URL}css/default/bestanswer.gif"></div>
                        </li>
                        <li class="zja5">最佳答案 </li>
                        <li class="zja3"></li>
                        <li class="zja4"></li>
                    </ul>
                    <div class="clr">
                    </div>
                </div>
                <div class="zjallcont">
                    <div class="zjleft">
                        <div class="readFace" id="userinfo-{$bestanswer['authorid']}">
                        </div>
                        <div class="touxiang">
                            <a target="_blank" href="{url user/space/$bestanswer['authorid']}">
                                <img align="absmiddle" src="{$bestanswer['author_avartar']}" onmouseout="closeuserinfo();"
                                    onmouseover="showuserinfo('{$bestanswer[authorid]}');"></a></div>
                        <div class="hyxinxi">
                            <span class="name"><a target="_blank" href="/jkzd_showperson.html?id=8702">{$bestanswer['author']}</a></span></div>
                    </div>
                    <div class="zjright">
                        <div class="zjt">
                            <img align="absmiddle" src="{SITE_URL}css/default/lefttime.gif" />
                            回答于:{$bestanswer['time']}&nbsp;&nbsp;<a href="javascript:inform('{$bestanswer['author']}',2);">举报</a>
                        </div>
                        <div class="qfgx">
                        </div>
                        <div class="zjcont">
                            <div class="wtcont">
                                {$bestanswer['content']}</div>
                            <div class="blank10">
                            </div>
                            <!--{loop $bestanswer['tags'] $tagindex $tag}-->
                            <!--{if ($tagindex%2) == 0}-->
                            <!--{if $tagindex!=0}-->
                            <div class="ask_gai">
                            </div>
                            <!--{/if}-->
                            <div class="ask_zhuiwen">
                                <span style="color: #5EBB0B; float: left; margin-right: 5px;">追问:</span>{$tag}
                            </div>
                            <!--{else}-->
                            <div class="ask_gai">
                            </div>
                            <div class="ask_zhuiwen">
                                <span style="color: #999999; float: left; margin-right: 5px;">回答:</span>{$tag}
                            </div>
                            <!--{/if}-->
                            <!--{/loop}-->
                            <div class="clr">
                            </div>
                            <div id="Div1">
                                <!--{if $bestanswer['comment']}-->
                                <h4>
                                    提问者对最佳答案的评价：</h4>
                                {$bestanswer['comment']}{else}谢谢您的解答！
                                <!--{/if}-->
                                <!--{if $bestanswer['commentlist']}-->
                                <fieldset>
                                    <legend><a title="查看评分记录" href="{url question/ajaxanswercomment/$bestanswer['id']}">
                                        该回答评分记录</a></legend>
                                    <ul>
                                        <!--{loop $bestanswer['commentlist'] $comment}-->
                                        <li><em>魅力&nbsp;{if $comment['credit']>0}+$comment['credit']{else}$comment['credit']{/if}</em><em>{echo
                                            cutstr($comment['content'],40,'');}</em><cite><a target="_blank" href="{url user/space/$comment['authorid']}">{echo
                                                cutstr($comment['author'],10,'');}</a></cite>{$comment['time']}</li>
                                        <!--{/loop}-->
                                    </ul>
                                </fieldset>
                                <!--{/if}-->
                            </div>
                        </div>
                        <div class="clr">
                        </div>
                        <!--{if 1==$user['groupid']}-->
                        <div class="wlhdb">
                            <h1>
                                管理该回答:</h1>
                            <span class="questioncontrol">
                                <input type="button" value="编辑内容" class="button1" onclick="javascript:document.location='{url question/editanswer/$bestanswer['id']}'" /></span>
                            <div class="clr">
                            </div>
                        </div>
                        <!--{/if}-->
                        <div class="zjlhdb ">
                            <p class="zjlhdbimg">
                                <img width="35px" height="36px" style="cursor: pointer" alt="支持" onclick="add_comment(1,$bestanswer['id'],$bestanswer['authorid']);"
                                    src="{SITE_URL}css/default/agree.gif">&nbsp;
                                <img width="35px" height="36px" style="cursor: pointer" alt="反对" onclick="add_comment(0,$bestanswer['id'],$bestanswer['authorid']);"
                                    src="{SITE_URL}css/default/aganist.gif">&nbsp;
                            </p>
                            支持(<span id="Span1" class="zhichi">{$bestanswer['support']}</span>) 反对(<span id="Span2"
                                class="fandui">{$bestanswer['against']}</span>)
                        </div>
                    </div>
                    <div class="clr">
                    </div>
                </div>
                <div class="zjbuttom">
                    <ul>
                        <li class="zjba1"></li>
                        <li class="zjba2"></li>
                        <li class="zjba3"></li>
                        <li class="zjba4"></li>
                    </ul>
                </div>
                <div class="clr"></div>
                </div>
            <!--{/if}-->
            <!--最佳答案结束-->              
                <div class="qita">                
                <!--{loop $answerlist $index $answer}-->
                <!--{if (!$answer['adopttime']) && ((($answer['authorid']!=$user['uid']) && ($user['uid'] > 0) && ($firstbuy == 0) && ($neednewbuy == 0)) || ($answer['authorid']==$user['uid'] && $user['uid'] > 0)) }-->
                         {eval $index++}
                         <div class="qitat"></div>
                         <div class="qtallcont">
                    <div class="qtleft">
                        <div class="readFace" id="userinfo-{$answer['authorid']}"></div>
                        <div class="touxiang">
                            <a target="_blank" href="{url user/space/$answer['authorid']}"><img align="absmiddle" src="{$answer['author_avartar']}" alt="{$answer['author']}" onmouseout="closeuserinfo();" onmouseover="showuserinfo('{$answer[authorid]}');" /></a>
                        </div>
                        <div class="hyxinxi">
                            <span class="name"><a target="_blank" href="{url user/space/$answer['authorid']}">{$answer['author']}</a></span>
                        </div>
                    </div>
                    <div class="qtright">
                        <div class="qtt">
                            <div class="louwei"><a href="#top" style="color:#2791FE;">#TOP#</a>&nbsp;&nbsp;{$answer['floor']}楼</div>
                            <img align="absmiddle" src="{SITE_URL}css/default/lefttime.gif" /> 回答于:{$answer['time']}
                            <a href="javascript:inform('{$answer['author']}',2);">举报</a>
                        </div>
                        <div class="clr"></div>
                        <div class="qfgx"></div>
                        <div class="qtcont">
                            <div class="wtcont" id="mc{$index}">{$answer['content']}</div>
                            <div class="blank10"></div>
                            <!--{loop $answer['tags'] $tagindex $tag}-->                        
                            <!--{if ($tagindex%2) == 0}-->
                            <!--{if $tagindex!=0}-->
                            <div class="ask_gai"></div>
                            <!--{/if}-->
                            <div class="ask_zhuiwen">
                                <span style="color:#5EBB0B;float:left;margin-right:5px;">追问:</span>{$tag}
                            </div>                        
                            <!--{else}-->                        
                            <div class="ask_gai"></div>                        
                            <div class="ask_zhuiwen">
                                <span style="color:#999999;float:left;margin-right:5px;">回答:</span>{$tag}
                            </div>

                            <!--{/if}-->
                            <!--{/loop}-->
                            <div class="clr"></div>
                            <!--{if $answer['commentlist']}-->
                            <div id="pinglun">
                                <fieldset>
                                    <legend><a title="查看回答评分记录" href="{url question/ajaxanswercomment/$answer['id']}" >该回答评分记录</a></legend>
                                    <ul>
                                        <!--{loop $answer['commentlist'] $comment}-->
                                        <li><em>魅力&nbsp;{if $comment['credit']>0}+$comment['credit']{else}$comment['credit']{/if}</em><em>{echo cutstr($comment['content'],40,'');}</em><cite><a target="_blank" href="{url user/space/$comment['authorid']}">{echo cutstr($comment['author'],10,'');}</a></cite>{$comment['time']}</li>
                                        <!--{/loop}-->
                                    </ul>
                                </fieldset>                            
                            </div>
                            <!--{/if}-->

                            <!--如果是提问者并且不是匿名用户，则显示“采纳为答案”按钮-->
                            <!--{if 0!=$question['authorid'] && ($question['authorid']==$user['uid']) }-->
                            <div class="wtcont">
                                <input type="button"  value="采纳为最佳答案" name="adoptanswer" onclick="adoptanswer({$answer['id']});" class="button2" />&nbsp;
                                <!--{if !$answer['tags'] || (count($answer['tags'])%2) == 0}-->
                                <input type="button"  value="继续追问" name="adoptanswer" onclick="tagquestion({$answer['id']});"  class="button1" />
                                <!--{/if}-->
                            </div>
                            <div class="clr"></div> 
                            <!--{/if}-->

                            <!--如果是回答者自己，则显示“修改答案”按钮-->
                            <!--{if $answer['status'] && ($answer['authorid']==$user['uid']) }-->
                            <input type="button"  value="修改答案" name="button"  class="button1"  onclick="javascript:document.location='{url question/editanswer/$answer['id']}'"/>&nbsp;
                            <!--{if $answer['tags']!='' && (count($answer['tags'])%2) != 0}-->
                            <input type="button"  value="继续回答" name="submit"  onclick="taganswer({$answer['id']});" class="button1"/>
                            <!--{/if}-->
                            <div class="clr"></div> 
                            <!--{/if}-->
                            <div class="clr"></div> 
                            <!--{if 1==$user['groupid']}-->
                            <div  class="wlhdb">
                                <h1>管理该回答:</h1>
                                <input type="button"  value="采纳为最佳答案" name="adoptanswer" onclick="adoptanswer({$answer['id']});" class="button2" />&nbsp;
                                <span class="questioncontrol"><input type="button"  value="编辑内容" class="button1" onclick="javascript:document.location='{url question/editanswer/$answer['id']}'" /></span>
                                <span class="questioncontrol"><input type="button" onclick="delanswer({$answer['id']},{$question['id']});" value="删除回答" class="button1"></span>
                                <div class="clr"></div>
                            </div>
                            <!--{/if}-->
                            <div class="zjlhdb ">
                                <p class="zjlhdbimg">
                                    <img width="35px" height="36px"  style="cursor:pointer" alt="支持" onclick="add_comment(1,$answer['id'],$answer['authorid']);" src="{SITE_URL}css/default/agree.gif">&nbsp;
                                    <img width="35px" height="36px"  style="cursor:pointer" alt="反对" onclick="add_comment(0,$answer['id'],$answer['authorid']);" src="{SITE_URL}css/default/aganist.gif">&nbsp;
                                </p>
                                支持(<span id="pjhao" class="zhichi">{$answer['support']}</span>)
                                反对(<span id="pjhao" class="fandui">{$answer['against']}</span>)
                            </div>
                        </div>
                        <!--{if (isset($adlist['question_view']['left3']) && trim($adlist['question_view']['left3']))}-->
                        <div  class="wtcont">{$adlist['question_view']['left3']}</div>
                        <!--{/if}-->
                    </div>
                    <div class="clr"></div>
                </div>
                         <div class="qtbuttom">
                            <ul>
                                <li class="qtba1"></li>
                                <li class="qtba2"></li>
                                <li class="qtba3"></li>
                                <li class="qtba4"></li>
                            </ul>   
                            <div class="clr"></div>
                         </div>          
                <!--{/if}-->
                <!--{/loop}-->
                 </div>
          <div class="pages"><div class="scott">{$departstr}</div></div> 
        <!--{/if}-->
        <!--{/if}-->
        <!--回答结束-->
        <!--{if (isset($adlist['question_view']['left2']) && trim($adlist['question_view']['left2']))}-->
        <div class="dh">{$adlist['question_view']['left2']}</div>
        <!--{/if}-->
    </div>
    <div class="right1">
        <div class="gg">
            <div class="ggtitle">
                <ul>
                    <li class="gga1"></li>
                    <li class="gga2">
                        <div class="juzhong">
                            <div class="qico">
                                <div class="irelate">
                                </div>
                            </div>
                            网友正在问
                        </div>
                    </li>
                    <li class="gga3"></li>
                </ul>
            </div>
            <div class="clr">
            </div>
            <div class="ggcon">
                <ul>
                    <!--{eval $nosolvelist=$this->
                    fromcache('nosolvelist');}-->
                    <!--{loop $nosolvelist $index $nosolve}-->
                    <li><a title="{$nosolve['title']}" target="_blank" href="{url question/view/$nosolve['id']}">
                        {eval echo cutstr($nosolve['title'],24);}</a></li>
                    <!--{/loop}-->
                </ul>
            </div>
            <div class="ggbuttom">
                <ul>
                    <li class="ggba1"></li>
                    <li class="ggba2"></li>
                    <li class="ggba3"></li>
                </ul>
            </div>
            <div class="clr">
            </div>
        </div>
        <!--{if (isset($adlist['question_view']['right1']) && trim($adlist['question_view']['right1']))}-->
        <div class="gg">
            {$adlist['question_view']['right1']}</div>
        <!--{/if}-->
    </div>
</div>
<div class="clr">
</div>
<link rel="stylesheet" href="{SITE_URL}css/common/imgpopup/imgpopup.css" />

<script type="text/javascript" src="{SITE_URL}js/imgpopup.js"></script>

<script type="text/javascript">
    //回答问题
    function mylogin(){
        mycontent.sync();
        var content=mycontent.getContentTxt();
        if(bytes(content)<=10){
            alert('回答内容不能少于10个字！');
            return;
        }
        if(0==$user['uid']){
            $.dialog({
                id:'loginDiv',
                position:'center',
                align:'left',
                width:300,
                height:100,
                title:'提交回答',
                okText:'登录并提交回答',
                fnOk:function(){
                    var username=$('#myusername').val();
                    var password=$('#mypassword').val();
                    $.ajax({
                        type: "post",
                        url: "{url user/ajaxlogin}",
                        data: "username="+username+"&password="+password,
                        success: function(msg){
                            if(1==msg){
                                $.dialog.close('loginDiv');document.answerForm.submit();
                            }else{
                                alert('用户名或密码错误！');
                            }
                        }
                    });
                },
                content:'<p /><table cellspacing="0" cellpadding="0" width="70%" border="0" valign="top"><tr><td class="f14" valign="top" nowrap align="left" width="40%" height="35">用户名 :&nbsp;&nbsp; </td><td valign="top" width="60%" height="35"><input maxlength="20" id="myusername" name="username"> </td></tr><tr><td class="f14" valign="top" nowrap align="left" height="35"> 密&nbsp&nbsp码 :&nbsp;&nbsp; </td><td valign="top" height="35"><input id="mypassword" type="password" maxlength="32" name="password"></td></tr></table>'
            });
        }else{
            document.answerForm.submit();
        }
    }

    //追加悬赏
    function addscore(){
        $.dialog({
            id:'addscoreDiv',
            position:'center',
            align:'left',
            width:300,
            height:100,
            title:'追加悬赏',
            fnOk:function(){document.addscoreForm.submit();$.dialog.close('addscoreDiv')},
            fnCancel:function(){$.dialog.close('addscoreDiv')},
            content:'&nbsp;&nbsp;&nbsp;&nbsp;提问期内，追加悬赏一次，可延长问题的有效期3天。<br />&nbsp;&nbsp;&nbsp;&nbsp;当您一次悬赏的财富值高于20分时，该问题将等同于新提出的问题，在所属分类的问题列表中显示为最新。 <div class="b4 bcg mb12"><form name="addscoreForm"  action="{url question/addscore/$question['id']}" method="post" >追加悬赏<select name="score"><option value="5" selected="selected">5</option><option value="10">10</option><option value="15">15</option><option value="20">20</option><option value="30">30</option><option value="40">40</option><option value="50">50</option></select>分</form></div>'
        });
    }

    //问题补充
    function showsupply(){
        var displaytype = $("#mysupplydiv").css("display");
        if(displaytype == 'none'){
            $("#mysupplydiv").css("display","");
            $("#addscorediv").css("display","none");
        }else{
            $("#mysupplydiv").css("display","none"); 
        }
    }
    //问题补充检查
    function check_mysupply(){
        mysupply.sync();
        var content = mysupply.getContentTxt();
        if($.trim(content) == ''){
            alert('问题补充不能只为图片或者其他html元素，必须有文字描述');
            return false;
        }
        $("form[name='supplyForm']").submit();
        
    }
    //提高悬赏
    function showaddscore(){
        var displaytype = $("#addscorediv").css("display");
        if(displaytype == 'none'){
            $("#addscorediv").css("display","");
            $("#mysupplydiv").css("display","none"); 
        }else{
            $("#addscorediv").css("display","none");   
        }
    }
    //提高悬赏检查
    function check_addscore(){
        $("form[name='addscoreForm']").submit();        
    }

    //问题管理
    function managequest(num){
        switch(num){
            case 3://移动分类
                var displaytype = $("#editcategorydiv").css("display");
                if(displaytype == 'none'){
                    $("#edittagdiv").css("display","none");                    
                    $("#editcategorydiv").css("display",""); 
                }else{
                    $("#editcategorydiv").css("display","none");   
                }
                break;
            case 4://关闭问题
                if(!confirm('确定关闭该问题?')==false){
                    document.location.href="{url question/close/$question['id']}";
                }
                break;
            case 5://修改标签
                var displaytype = $("#edittagdiv").css("display");
                if(displaytype == 'none'){
                    $("#editcategorydiv").css("display","none"); 
                    $("#edittagdiv").css("display","");                    
                }else{
                    $("#edittagdiv").css("display","none");   
                }                    
                break;
            case 6://删除问题
                if(!confirm('确定删除问题？该操作不可返回！')==false){
                    document.location.href="{url question/delete/$question['id']}";
                }
                break;
            default:
                alert("非法操作！");
                break;
        }
    }

    //修改回答
    function showeditanswer(index){
        var displaytype = $("#editanswerdiv"+index).css("display");
        if(displaytype == 'none'){
            $("#editanswerdiv"+index).css("display","");
            //$("#mysupplydiv").css("display","none"); 
        }else{
            $("#editanswerdiv"+index).css("display","none");   
        }
    }
    
    function check_editanswer(answereditor,index){
        answereditor.sync();
        var content=answereditor.getContentTxt();
        if(bytes(content)<=10){
            alert('回答内容不能少于10个字！');
            return false;
        }
        $("#editanswerForm"+index).submit();
    }

    //管理回答
    function adoptanswer(aid){
        $.dialog({
            id:'editanswerDiv',
            position:'center',
            align:'left',
            width:400,
            height:110,
            title:'采纳感言',
            fnOk:function(){document.editanswerForm.submit();$.dialog.close('editanswerDiv')},
            fnCancel:function(){$.dialog.close('editanswerDiv')},
            content:'对该回答的感言： <div><form name="editanswerForm"  action="{url question/adopt}" method="post" ><textarea id="mc" name="content" style="width: 99%; padding-top: 1px; font-size: 14px;" rows="4" cols="50" >谢谢您的解答！</textarea><input type="hidden"  value="{$question['id']}" name="qid"/><input type="hidden" id="ma" value="'+aid+'" name="aid"/></form></div>'
        });
    }
    //追问模块--追问
    function tagquestion(aid){
        $.dialog({
            id:'tag_ask',
            position:'center',
            align:'left',
            width:400,
            height:110,
            title:'继续追问',
            fnOk:function(){
                if($.trim($("#mc").val()) == ""){
                    alert("追问内容不能为空");
                    return false;
                }
                document.tagAskForm.submit();
                $.dialog.close('tag_ask')
            },
            fnCancel:function(){$.dialog.close('tag_ask')},
            content:'追问内容： <div><form name="tagAskForm"  action="{url question/tagask}" method="post" ><textarea id="mc" name="tag_ask" style="width: 99%; padding-top: 1px; font-size: 14px;" rows="4" cols="300" ></textarea><input type="hidden"  value="{$question['id']}" name="qid"/><input type="hidden" id="ma" value="'+aid+'" name="aid"/></form></div>'
        });
    }
    //追问模块--回答
    function taganswer(aid){
        $.dialog({
            id:'tag_answer',
            position:'center',
            align:'left',
            width:400,
            height:110,
            title:'继续追问',
            fnOk:function(){
                if($.trim($("#mc").val()) == ""){
                    alert($("#mc").val());
                    return false;
                }
                document.tagAskForm.submit();
                $.dialog.close('tag_answer')
            },
            fnCancel:function(){$.dialog.close('tag_answer')},
            content:'继续回答的内容： <div><form name="tagAskForm"  action="{url question/tagask}" method="post" ><textarea id="mc" name="tag_answer" style="width: 99%; padding-top: 1px; font-size: 14px;" rows="4" cols="50" ></textarea><input type="hidden"  value="{$question['id']}" name="qid"/><input type="hidden" id="ma" value="'+aid+'" name="aid"/></form></div>'
        });
    }
    
    //扣除用户的财富值
    function displayAnswer(){       
        //去后台删除用户的财富值
	$.ajax({
                type: "post",
                url: "{url user/ajaxReduceScore}",
                data: "userid="+$user['uid']+"&qid="+$question['id'],
                success: function(msg){
                if("" !=msg){
                       if(1 == msg){
                          alert('魅力值不够!');
                       }
                       else if(0 == msg){
                          if ($user['uid'] == 0) {
			                    document.location.href="{url user/login}";
                          }
                          else {                        
		                        document.location.href="{url user/default}";
			                    alert('财富值不够!请充值!');
                          }
                       }
                       else{                            
			                   showTips("财富值 - (" + msg + ")");
                               $("#displayAnswerbutton").hide();
                               $("#owner").hide();
                               location.reload();
                       }
                }else{
                      alert('扣除失败,请过会再试!');
                }
             }
        });        
    }
    
    function showTips(tips){
       $('#tipsClass').html("&nbsp;&nbsp;&nbsp;" + tips);
       $('#tipsClass').css({
         'background': 'white',  
         'font-size' : 16 + 'px',            
         'text-align': 'center',  
         'width'     : 'auto',  
         'color'     : '#FE642E',  
         'opacity'   : '0.9' 
        }).show();  
       $('#tipsClass').fadeOut(2000);
     //setTimeout( function(){$('#tipsClass').fadeOut();}, (2 * 1000));  
    }

    //删除回答
    function delanswer(aid,qid){
        if(confirm("确定删除该回答?")){
            document.location.href='{url question/deleteanswer/'+aid+'/'+qid+'}';
        }
    }
    //审核回答
    function verifyanswer(aid,qid){
        document.location.href='{url question/verifyanswer/'+aid+'/'+qid+'}';
    }
    
    function inform(name,type){
        var content = name+'的回答';
        if(type==1){
            content = name+'的提问';
        }
        $.dialog({
            id:'informDiv',
            position:'center',
            align:'left',
            width:500,
            title:'举报',
            fnOk:function(){document.informform.submit();$.dialog.close('informDiv')},
            fnCancel:function(){$.dialog.close('informDiv')},
            content:'<div style="display: block; border-bottom: 1px dotted rgb(136, 136, 136);" class="font_orange2">如果您发现不正当的内容或行为，请及时联系管理员！</div><form name="informform" action="{url inform/add}" method="POST"> <div><p><strong>举报内容：</strong>'+content+'</p><p><strong>举报原因：</strong>(可多选)</p><p><input type="checkbox" name="informkind[]" value="0" />含有反动的内容</p><p><input type="checkbox" name="informkind[]" value="1" />含有人身攻击的内容</p><p><input type="checkbox" name="informkind[]" value="2" />含有广告性质的内容</p><p><input type="checkbox" name="informkind[]" value="3" />涉及违法犯罪的内容</p><p><input type="checkbox" name="informkind[]" value="4" />含有违背伦理道德的内容</p><p><input type="checkbox" name="informkind[]" value="5" />含色情、暴力、恐怖的内容</p><input type="checkbox" name="informkind[]" value="5" />含有恶意无聊灌水的内容</p></div><input type="hidden"  value="{$question['id']}" name="qid"/><input type="hidden"  value="'+content+'" name="content"/><input type="hidden"  value="{$question['title']}" name="title"/></from>'
        });
    }
    
    function showuserinfo(uid){
        $("#userinfo-"+uid).load("{SITE_URL}?user/ajaxuserinfo/"+uid+".html");
    }
    function closeuserinfo(uid){
        $("#userinfo-"+uid).html("");
    }
    function add_comment(type,aid,uid){
        if(0==$user['uid']){
            alert("登陆之后才能进行该操作！");
            return false;
        }else if($user['uid'] == uid){
            alert("不能给自己回答评分!");
            return false;
        }
        var optionsstr = '{$support}';
        if(type == 0)
            optionsstr = '{$against}';
        
        $.dialog({
            id:'add_commentdiv',
            position:'center',
            align:'left',
            width:200,
            height:110,
            title:'回答评分',
            fnOk:function(){
                if("" == $.trim($("#shortcomment").val())){
                    alert("简评内容不能为空!");
                    return false;
                }
                document.addcommentForm.submit();
                $.dialog.close('add_commentdiv')
            },
            fnCancel:function(){$.dialog.close('add_commentdiv')},
            content:'<p /><form name="addcommentForm" id="addcommentForm" action="{url question/answercomment}" method="POST"><input type="hidden" name="qid" value="'+$question['id']+'" /><input type="hidden" name="aid" value="'+aid+'" /><input type="hidden" name="touid" value="'+uid+'" /><table cellspacing="0" cellpadding="0" width="80%" border="0" valign="top" align="center"><tr><td class="f14" valign="top" nowrap align="left" width="40%" height="35">魅力值 :&nbsp;&nbsp; </td><td valign="top" width="60%" height="35">'+optionsstr+'</td></tr><tr><td class="f14" valign="top" nowrap align="left" height="35"> 简&nbsp&nbsp评 :&nbsp;&nbsp; </td><td valign="top" height="35"><textarea id="shortcomment" name="content" cols="30"  rows="3" maxlength="30"></textarea></td></tr></table></form>'
        });    
    }
    $(document).ready(function () {
        $("legend a").fancybox({'titlePosition':'inside'});
        SyntaxHighlighter.highlight();//代码高亮显示
        /*ajax imgpopup*/
        $(".wtcont p img").each(function(i){//获取问题、回答中的所有图片地址
            var img = $(this);
            $.ajax({
                type: "POST",
                url: "{url question/ajaxchkimg}",
                async: true,
                data: "imgsrc="+img.attr("src"),
                success: function(status){
                    if('1' == status){
                        img.wrap("<a href='"+img.attr("src")+"' title='"+img.attr("title")+"' ></a>");
                        img.parent().fancybox({
                            'overlayShow'	: false,
                            'transitionIn'	: 'elastic',
                            'transitionOut'	: 'elastic',
                            'titlePosition'	: 'inside'
                        });
                    }
                }
            });
        });
        
//        if (($neednewbuy) && ($firstbuy == 0)) {
//            $("#displayAnswerbutton").show();
//	        $("#displayAnswerbutton").val("更新购买");
//        }       
//       
//        if (($firstbuy) && ($neednewbuy == 0)) {
//            $("#displayAnswerbutton").show();
//	        $("#displayAnswerbutton").val("购买");
//        }
        
        if (($firstbuy == 0) && ($neednewbuy == 0) && ($user['uid'] > 0)) {   //已经购买过，没有内容没有更新
	            $("#displayAnswerbutton").hide();               
        }
    });
</script>

{template footer}